Emacs Tips
現在のバッファを選択バッファを出さずに消したい
code:memo.el
(defun my-kill-current-buffer
(interactive)
(kill-buffer (current-buffer)))
(define-key global-map (kbd "C-M-k" 'my-kill-current-buffer)
現在のバッファの状態がmodifiedであるかにかかわらず強制的に消したい。
code:memo.el
(defun my-force-kill-current-buffer
(interactive)
(set-buffer-modified-p nil)
(kill-buffer (current-buffer))))
(define-key global-map (kbd "C-M-k" 'my-force-kill-current-buffer)
auto-installの *auto-install http~*-wget のバッファを消したい
code:memo.el
(require 'cl)
(defun my-erase-auto-install-buffer ()
(dolist (buf (buffer-list))
(if (eq (string-match "^\\*auto-install " (buffer-name buf)) 0)
(progn
;; (print "ok")
(kill-buffer buf)))))
;;実行する
(my-erase-auto-install-buffer)